import QtQuick 2.0

import "../../common"
import "../../../js/util.js" as Util
import "../../../js/UI.js" as Style

Page{
    id: showlist

    ATitle{
        id: m_titleID
        anchors.top: parent.top
        anchors.left: parent.left
        m_text: qsTr("学科讲座")
        m_textcol: Style.fonttilteColor
        onBackSignal:subpageSignal(1,-1)
    }

    ListModel{
        id: m_college
        ListElement{
            name:  "茶山竹海讲座1"
            time: "2020-11-10"
            numbers: "500"
            state: "正在报名"
        }
        ListElement{
            name:  "茶山竹海讲座2"
            time: "2020-11-11"
            numbers: "500"
            state: "正在报名"
        }
        ListElement{
            name:  "茶山竹海讲座3"
            time: "2020-11-12"
            numbers: "500"
            state: "正在报名"
        }
        ListElement{
            name:  "茶山竹海讲座4"
            time: "2020-11-13"
            numbers: "500"
            state: "未开始报名"
        }
        ListElement{
            name:  "茶山竹海讲座5"
            time: "2020-11-14"
            numbers: "500"
            state: "未开始报名"
        }
    }

    ListView{
        id: listview
        anchors.top: m_titleID.bottom
        anchors.left: parent.left
        anchors.right: parent.right
        width: parent.width
        height: parent.height - m_titleID.height
        clip: true
        model: m_college
        delegate: BaseLine{
            height: m_lineValue * 1.2
            width: parent.width
            AText {
                id: m_name
                anchors.left: parent.left
                anchors.leftMargin: m_lineValue*0.2
                anchors.top: parent.top
                anchors.topMargin: 0.2*m_lineValue
                text: model.name
                font.pointSize: Style.fontlittlcontent
                color:Style.fonttilteColor
            }
            AText {
                id: m_time
                anchors.left: parent.left
                anchors.leftMargin: m_lineValue*0.2
                anchors.top: m_name.bottom
                anchors.topMargin: 0.1*m_lineValue
                text: "时间:"+model.time
                font.pointSize: Style.fontlittlcontent - 2
                color:Style.fonttilteColor
            }
            AText{
                anchors.left: m_time.right
                anchors.leftMargin: m_lineValue*0.2
                anchors.top: m_name.bottom
                anchors.topMargin: 0.1*m_lineValue
                text: "人数:"+model.numbers
                font.pointSize: Style.fontlittlcontent - 2
                color:Style.fonttilteColor
            }
            AText{
                anchors.right: parent.right
                anchors.rightMargin: 0.2*m_lineValue
                anchors.verticalCenter: parent.verticalCenter
                text: model.state
                font.pointSize: Style.fontlittlcontent - 2
                color:Style.fonttilteColor
            }

            onMouseclickSignal: {
                var str =  qsTr("暂不支持报名")
                var temp = Util.showPopWin(m_root_id,"qrc:/qml/form/dialog/Dialog_sure_and_cancel_warning.qml",str,function (retValue){});
                temp.sure_cancel_signal.disconnect(onSure_cancel_signal)
                temp.sure_cancel_signal.connect(onSure_cancel_signal)
            }
            SplitLine {
                anchors {
                    bottom: parent.bottom
                    left: parent.left
                    right: parent.right;
                }
            }
        }
    }
    function onSure_cancel_signal(value)
    {

    }
}
